package com.cskaoyan.bean;

import lombok.Data;

import java.util.*;

/**
 * @ClassName:MarketChannelData
 * @Description:TODO
 * @author:leiwenjie
 * @date:2022/9/9 16:15
 * @version:1.0
 */
@Data
public class MarketChannelData {


    public static List<MarketChannel> getList() {
        // new MarketChannel()


        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("ZTO", "中通快递");
        hashMap.put("YTO", "圆通速递");
        hashMap.put("YD", "韵达速递");
        hashMap.put("YZPY", "邮政快递包裹");
        hashMap.put("EMS", "EMS");
        hashMap.put("DBL", "德邦快递");
        hashMap.put("FAST", "快捷快递");
        hashMap.put("ZJS", "宅急送");
        hashMap.put("UPS", "UPS");
        hashMap.put("DHL", "DHL");
        hashMap.put("FEDEX", "FEDEX联邦(国内件)");
        hashMap.put("FEDEX_GJ", "FEDEX联邦(国际件)");

        Set<Map.Entry<String, String>> entries = hashMap.entrySet();
        ArrayList<MarketChannel> list = new ArrayList<>();
        for (Map.Entry<String, String> entry : entries) {
            String code = entry.getKey();
            String name = entry.getValue();
            MarketChannel channel = new MarketChannel();
            channel.setCode(code);
            channel.setName(name);
            list.add(channel);
            //list.add("code:" + "\"" + code + "\"" + "," + "name:" + "\"" + name + "\"");
        }


        return list;
    }

    public static String getValue(String key) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("ZTO", "中通快递");
        hashMap.put("YTO", "圆通速递");
        hashMap.put("YD", "韵达速递");
        hashMap.put("YZPY", "邮政快递包裹");
        hashMap.put("EMS", "EMS");
        hashMap.put("DBL", "德邦快递");
        hashMap.put("FAST", "快捷快递");
        hashMap.put("ZJS", "宅急送");
        hashMap.put("UPS", "UPS");
        hashMap.put("DHL", "DHL");
        hashMap.put("FEDEX", "FEDEX联邦(国内件)");
        hashMap.put("FEDEX_GJ", "FEDEX联邦(国际件)");

        String s = hashMap.get(key);
        return s;
    }
}
